package com.kunyi.web.im.websocket.application.api;

import com.kunyi.web.im.websocket.TransportService;
import com.kunyi.web.serviceapi.im.api.ISendWebSocketMessageClient;
import com.kunyi.web.serviceapi.im.entity.dto.MessageDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName Demo
 * @Description websocket接收消息
 * @Author zhenguo.zhuang
 * @Date 2024/3/29 16:52
 * @Version 1.0
 */
@Slf4j
@RestController
public class SendWebSocketMessageImpl implements ISendWebSocketMessageClient {
    @Autowired
    TransportService transportService;
    /**
     * @author: zhenguo.zhuang
     * @Description 服务端向客户端发送系统类信息
     * @Date 16:53 2024/3/29
     * @Param :
     * @return null
     **/
    @Override
    public void  sendWebSocketSystemMessage(MessageDto dto){
        transportService.sendMsg(dto);
    }

    /**
     * @author: zhenguo.zhuang
     * @Description 服务端向客户端发送带有主题的消息
     * @Date 16:53 2024/3/29
     * @Param msg: 向客户端推送的消息
     * @Param topic: 主题信息
     * @return null
     **/
    @Override
    public void  sendWebSocketTopicMessage(MessageDto dto){
        transportService.sendMsg(dto);
    }




}
